package com.qlm.entity;

import com.jfinal.plugin.activerecord.Record;

/**
 * 结果对象，可以直接toString成json格式
 * @author wangzih
 *
 */
public class ResultMsg extends Record{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Object t;
	
	@Override
	public String toString() {
		return "{\"msg\":\"" + msg + "\",\"status\":\"" + status + "\"}";
	}

	public <T> void setObj(T t1){
		set("obj", t1);
		this.t = t1;
	}
	
	@SuppressWarnings("unchecked")
	public <T> T getObj(){
		return (T) t;
	}
	
	private String msg ="";
	private boolean status = false;
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
		set("msg", msg);
	}
	public boolean getStatus() {
		return status;
	}
	public void setStatus(boolean status) {
		this.status = status;
		set("status", status);
	}

}
